package com.mtsmda.questions;

class Person{
	public Person(String name, int age) {
		this.name = name;
		this.age = age;
		++pid;
	}
	
	static int pid;
	int age;
	String name;
	
}

public class TestClassHowParamForMethod {
	
	public static void main(String[] args) {
		Person p1 = new Person("John", 22);
		Person change = new TestClassHowParamForMethod().change(p1);
		System.out.println(p1.age + " " + p1.name + " " + p1.pid);
		System.out.println(change.age + " " + change.name + " " + change.pid);
	}
	
	private Person change(Object o){
		Person p2 = (Person) o;
		p2.age = 25;
		return p2;
	}
	
}